#!/usr/bin/env python
# coding: utf-8
"""
This file is part of pyfile2object.

Copyright 2010 Pedro Ignacio Guridi <pedro.guridi@gmail.com>

Foobar is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

You should have received a copy of the GNU Lesser Public License
along with pyfile2object.  If not, see <http://www.gnu.org/licenses/>.
"""


class ImportTemplate:
	"""
	This class is the import template settings,
	taken from the XML.
	
	"""

	def __init__(self, name):
		self.__name = name
		self.__fields = []
		self.__exclude_line_prefix = None

	def addField(self, fieldName, column, lenght, setter, fieldType):
		field = { "name": fieldName, "start_column": int(column), "end_column": int(lenght), "setter": setter,
				"type": fieldType }
		self.__fields.append(field)
		

	def getName(self):
		return self.__name

	def getFields(self):
		return self.__fields

	def setExcludeLinePrefix(self, prefix):
		self.__exclude_line_prefix = prefix
